home *** CD-ROM | disk | FTP | other *** search
- '' Global variables
-
- GLOBAL TitleShortName$
- GLOBAL TitleLongName$
- GLOBAL PromptForPath%
- GLOBAL DefaultPath$
- GLOBAL ProgManGroup$
- GLOBAL ProgManItem$
-
- '' ****************************************************************
- '' ** Setup Variables
- '' ****************************************************************
-
- TitleShortName$ = "Virtual Encounter"
- TitleLongName$ = "Virtual Encounter"
- ProgmanGroup$ = "Virtual Encounter"
-
- '***********************************************************************
- '** Mainline
- '***********************************************************************
-
- GLOBAL CUIDLL$
-
- '' Include files
- '$INCLUDE 'setupapi.inc'
-
- '' Custom UI dll
- CUIDLL$ = "mscuistf.dll"
-
- '' Dialog ID's
- CONST DESTPATH = 1000
- CONST APPHELP = 2000
- CONST TOOBIG = 3000
- CONST BADPATH = 4000
- CONST SUCCESS = 5000
-
- '' Bitmap ID
- CONST LOGO = 1
-
- '' Functions and subroutines
- DECLARE FUNCTION AddFont LIB "mscuistf.dll" (szFont$, szName$) AS INTEGER
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
- DECLARE FUNCTION CopyFiles(szTitleDir$) AS INTEGER
- DECLARE FUNCTION ChkAgreement LIB "vecuistf.dll" AS INTEGER
- DECLARE SUB ShowSuccess
- DECLARE SUB ModifyProgramManager
-
- '' The following statement turns size checking off. Set it to scmOnFatal
- '' to enable size checking, where Setup will compare the disk file size
- '' with the INF file size and report an error if they are not the same.
-
- i% = SetSizeCheckMode(scmOff)
-
- '' Set the title and banner bitmap. You must rebuild MSCUISTF.DLL to
- '' alter the banner bitmap.
-
- SetTitle "Virtual Encounter Setup"
- SetBitmap "vecuistf.dll", LOGO
-
- '' Check for agreement
- IF ChkAgreement() = 0 THEN
- GOTO QUIT
- ENDIF
-
- '' Read in the INF file.
-
- ReadInfFile GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
- szTitleDir$ = GetWindowsDir()
-
- '' Copy files
- IF CopyFiles(szTitleDir$) = 0 THEN
- GOTO QUIT
- ENDIF
-
- CreateIniKeyValue szTitleDir$ + "CONTROL.INI", "Screen Saver.Virtual Encounter", "Mirror", szTitleDir$, cmoOverwrite
- '' CreateIniKeyValue szTitleDir$ + "CONTROL.INI", "Screen Saver.Virtual Encounter", "CD", GetSymbolValue("STF_SRCDIR"), cmoOverwrite
- CreateIniKeyValue szTitleDir$ + "SYSTEM.INI", "boot", "SCRNSAVE.EXE", szTitleDir$ + "VENCNTR.SCR", cmoOverwrite
-
- ModifyProgramManager
-
- '' Success dialog
- '' ShowSuccess
-
- QUIT:
-
- END
-
- '*************************************************************************
- '** Purpose:
- '** Copies the files in the INF file
- '** Arguments:
- '** szTitleDir$ - destination directory for the title files
- '** Returns
- '** 1 if files were copied, 0 otherwise
- '*************************************************************************
-
- FUNCTION CopyFiles(szTitleDir$) STATIC AS INTEGER
-
- '' Add all system files to the copy list
- AddSectionFilesToCopyList "System Files", GetSymbolValue("STF_SRCDIR"), GetWindowsSysDir()
- AddSectionFilesToCopyList "Virtual Encounter Files", GetSymbolValue("STF_SRCDIR"), szTitleDir$
-
- '' Check size
- szExtras$ = "Extra"
- szCosts$ = "Costs"
- szNeededs$ = "Neededs"
- FOR i% = 1 TO 26 STEP 1
- AddListItem szExtras$, "0"
- NEXT i%
-
- '' Get amount of space required
- StillNeed& = GetCopyListCost(szExtras$, szCosts$, szNeededs$)
-
- '' Put up a message if there is not enough space
- FOR i% = 1 TO 26 STEP 1
- IF VAL(GetListItem(szNeededs$, i%)) > 0 THEN
-
- SetSymbolValue "String1", LTRIM$(STR$(VAL(GetListItem(szCosts$, i%)) / 1024))
- SetSymbolValue "String2", CHR$(i% - 1 + ASC("A"))
-
- TOOBIG:
-
- sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfoDlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO TOOBIG
- END IF
- UIPop 1
- CopyFiles = 0
- GOTO DONTCOPY
- END IF
- NEXT i%
-
- '' Copy the files
- CopyFilesInCopyList
-
- CopyFiles = 1
-
- DONTCOPY:
-
- END FUNCTION
-
-
- '*************************************************************************
- '** Purpose:
- '** Puts up a success dialog
- '*************************************************************************
-
- SUB ShowSuccess STATIC
-
- SUCCESS:
-
- SetSymbolValue "String1", TitleShortName$
- sz$ = UIStartDlg(CUIDLL$, SUCCESS, "FInfoDlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO SUCCESS
- END IF
- UIPop 1
-
- END SUB
-
-
- '*************************************************************************
- '** Purpose:
- '** Appends a file name to the end of a directory path,
- '** inserting a backslash character as needed.
- '** Arguments:
- '** szDir$ - full directory path (with optional ending "\")
- '** szFile$ - filename to append to directory
- '** Returns:
- '** Resulting fully qualified path name.
- '*************************************************************************
-
- FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
- IF szDir$ = "" THEN
- MakePath = szFile$
- ELSEIF szFile$ = "" THEN
- MakePath = szDir$
- ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
- MakePath = szDir$ + szFile$
- ELSE
- MakePath = szDir$ + "\" + szFile$
- END IF
- END FUNCTION
-
- '*************************************************************************
- '** Purpose:
- '** Creates program manager entries
- '*************************************************************************
-
- SUB ModifyProgramManager STATIC
-
- '' Create the program manager group
-
- CreateProgmanGroup ProgmanGroup$, "", cmoNone
- ShowProgmanGroup ProgmanGroup$, 1, cmoNone
-
- '' Create icons
- CreateProgmanItem ProgmanGroup$, "VE Player", "veplayer.exe mono", "", cmoOverwrite
- CreateProgmanItem ProgmanGroup$, "VE Player - Stereoscopic", "veplayer.exe stereo", "", cmoOverwrite
-
- END SUB
-